#ifndef __wrk_process__h
#define __wrk_process__h

// #ifdef __cplusplus  
// extern "C" {  
// #endif  

#include <sys/types.h>

#include "wrk_config.h"

// #define LOCKFILE "/var/run/dist-wrk.pid"
#define LOCKFILE "dist-wrk.pid"
// #define MAX_WORKER_PROCESS_NUM 1

extern int MAX_WORKER_PROCESS_NUM;

typedef struct  {
	pid_t 	        pid;
	unsigned long   taskid;
	enum {
        IDEL, RUNNING
    } status;
	int 	        channel[2];
	char 	        *name;
}wrk_worker_process_t;


wrk_worker_process_t *get_process_by_taskid(unsigned int taskid);

wrk_worker_process_t *get_one_idle_worker();


void wrk_init_signals();
// #ifdef __cplusplus  
// }
// #endif  
#endif